package h.ku.eval
{
	import h.ku.lang.*;
	
	public class Args
	{
		public var caller:FunctionEval
		public var arguments:Array
		public var callingObject:*
		
		public function Args(c:FunctionEval,b:Array,h:*=null)
		{
			this.caller = c
			this.callingObject = h
			var a:Array = b.concat()
			for(var i:uint=0;i<a.length;i++)
			{
				if(a[i] is hkuNumber)
				{
					a[i] = hkuNumber(a[i]).numValue
				}
				if(a[i] is hkuArray)
				{
					a[i] = hkuArray(a[i]).arrValue
				}
				if(a[i] is hkuString)
				{
					a[i] = hkuString(a[i]).strValue
				}
				if(a[i] is hkuBoolean)
				{
					a[i] = hkuBoolean(a[i]).boolValue
				}
			}
			this.arguments = a
		}
	}
}